var mpTime = null, mnTime = null, mpuTime, subTimeEi = null, bindWheellTimer = null;
Readchar.Plugins = {pageScroll: function (pageArray, pageClass) {
    var pageList = pageArray, pageClass = typeof pageClass == "string" ? $(pageClass) : pageClass;
    var pageHeader, pageFooter, pageContainer, currentURL = window.location.href, urlStr = currentURL.substring(0, currentURL.indexOf("#") != -1 ? currentURL.indexOf("#") : currentURL.length);
    if (pageArray instanceof Array) {
        pageHeader = $(pageArray[0]);
        pageFooter = $(".footer");
        pageContainer = $(".mecare-page-container")
    } else {
        console.log("你出入的参数类型是" + (pageArray instanceof Array) + ",请传入正确的参数，参数为数组");
        return false;
    }
    var pageIndex = 0, prePageIndex = 0;

    function initFn() {
        if (pageClass[0].nodeType) {
            pageClass.height(Readchar.Style.getFullPageSize().height);
        } else {
            console.log("请输入正确的pgeClass类名，该参数不是一个Dom节点");
        }
        $(".r-navi-icon").bind({click: function () {
            var naviIndex = $(".r-navi-icon").index($(this));
            if (naviIndex == 7) {
                naviIndex = 9;
            } else if (naviIndex == 0) {
                naviIndex = 1;
            } else {
                naviIndex++;
            }
            window.location.href = urlStr + pageList[naviIndex];
            scrollPageTo();
        }});
        $(".pn-list > a").click(function () {
            var naIndex = $(".pn-list > a").index($(this));
            if ((naIndex + 1) % 7 == 1) {
                window.location.href = urlStr + pageList[1];
            }
            if ((naIndex + 1) % 7 == 2) {
                window.location.href = urlStr + pageList[2];
            }
            if ((naIndex + 1) % 7 == 3) {
                window.location.href = urlStr + pageList[3];
            }
            if ((naIndex + 1) % 7 == 4) {
                window.location.href = urlStr + pageList[7];
            }
            scrollPageTo();
        });
        scrollPageTo();
        bindWhellAgain();
    }

    initFn();
    function getDirect() {
    }

    function scrollPageTo() {
        Readchar.Event.unBuildWheel(scrollPageTo);
        if (bindWheellTimer) {
            console.log("清除滚轮定时器");
            clearTimeout(bindWheellTimer);
            bindWheellTimer = null;
        }
        var direct = Readchar.Event.getWheelDelta(Readchar.Event.getEvent()) ? Readchar.Event.getWheelDelta(Readchar.Event.getEvent()) : 0;
        if (direct == 0) {
            var pageId = window.location.href.substring(urlStr.length);
            for (var i = 0; i < pageArray.length; i++) {
                if (pageArray[i] == pageId) {
                    pageIndex = i;
                    if (pageIndex == 8) {
                        pageIndex--;
                    }
                    if (pageIndex > 0) {
                        scrollHeader();
                    }
                    if (pageIndex == 10) {
                        scrollFooter();
                        $(".mecare-action").css({"transform": "translate3d(0,-" + (pageIndex - 2) + "00%,0)", "-webkit-transform": "translate3d(0,-" + (pageIndex - 2) + "00%,0)", "-moz-transform": "translate3d(0,-" + (pageIndex - 2) + "00%,0)", "-o-transform": "translate3d(0,-" + (pageIndex - 2) + "00%,0)"});
                    }
                }
            }
        }
        if (direct != 0) {
            if (pageIndex == 5 && !pageAnimateBox.pageFiveEffect(direct)) {
                Readchar.Event.buildWheel(scrollPageTo);
                return false;
            }
            if (pageIndex == 7 && !pageAnimateBox.pageSevenEffect(direct)) {
                Readchar.Event.buildWheel(scrollPageTo);
                return false;
            }
            if (pageIndex == 9 && !pageAnimateBox.pageNineEffect(direct)) {
                bindWhellAgain();
                return false;
            }
        }
        if (direct < 0) {
            if (pageIndex < 10) {
                pageIndex++;
            }
            if (pageIndex == 1) {
                scrollHeader();
            }
            if (pageIndex == 10) {
                scrollFooter();
            }
        }
        if (direct > 0) {
            if (pageIndex > 0) {
                pageIndex--;
                if (pageIndex == 8) {
                    pageIndex--;
                }
            }
            if (pageIndex == 0) {
                pageContainer.css({"transform": "translate3d(0,0,0)", "-webkit-transform": "translate3d(0,0,0)", "-moz-transform": "translate3d(0,0,0)", "-o-transform": "translate3d(0,0,0)"});
            } else if (pageIndex == 9) {
                scrollHeader();
            }
        }
        if (pageIndex != 10) {
            $(".mecare-action").css({"transform": "translate3d(0,-" + (pageIndex - 1) + "00%,0)", "-webkit-transform": "translate3d(0,-" + (pageIndex - 1) + "00%,0)", "-moz-transform": "translate3d(0,-" + (pageIndex - 1) + "00%,0)", "-o-transform": "translate3d(0,-" + (pageIndex - 1) + "00%,0)"});
        }
        window.location.href = urlStr + pageArray[pageIndex];
        $(".r-navi-icon").removeClass("r-navi-action");
        if (pageIndex == 0 || pageIndex == 1) {
            $(".r-navi-icon").eq(0).addClass("r-navi-action");
        } else if (pageIndex == 8) {
            $(".r-navi-icon").eq(6).addClass("r-navi-action");
        } else if (pageIndex > 8) {
            $(".r-navi-icon").eq(7).addClass("r-navi-action");
        } else {
            $(".r-navi-icon").eq(pageIndex - 1).addClass("r-navi-action");
        }
        if (direct == 0) {
            pageAnimateBox.pageDownEffect(pageIndex, direct, prePageIndex);
        } else {
            pageAnimateBox.pageDownEffect(pageIndex, direct);
        }
        prePageIndex = pageIndex;
        bindWhellAgain();
        console.log("已经滚动到" + pageIndex + "屏");
    }

    function bindWhellAgain() {
        if (!bindWheellTimer) {
            console.log("重新绑定滚轮监听事件");
            bindWheellTimer = setTimeout(function () {
                Readchar.Event.buildWheel(scrollPageTo);
                clearTimeout(bindWheellTimer);
            }, 1000)
        }
    }

    function scrollHeader() {
        pageContainer.css({"transform": "translate3d(0,-" + pageHeader.height() + "px,0)", "-webkit-transform": "translate3d(0,-" + pageHeader.height() + "px,0)", "-moz-transform": "translate3d(0,-" + pageHeader.height() + "px,0)", "-o-transform": "translate3d(0,-" + pageHeader.height() + "px,0)"});
    }

    function scrollFooter() {
        pageContainer.css({"transform": "translate3d(0,-" + (pageHeader.height() + pageFooter.height()) + "px,0)", "-webkit-transform": "translate3d(0,-" + (pageHeader.height() + pageFooter.height()) + "px,0)", "-moz-transform": "translate3d(0,-" + (pageHeader.height() + pageFooter.height()) + "px,0)", "-o-transform": "translate3d(0,-" + (pageHeader.height() + pageFooter.height()) + "px,0)"});
    }
}}
var pageAnimateBox = {pnList: $(".pn-list > a"), navList: $(".navi-fixed"), cupElm: $(".cuptime-mp3"), cuptimeLeft: $(".cuptime-left"), cuptimeRight: $(".cuptime-right"), mpZn: $(".mp-zn"), mpZnParent: $(".f-page"), cupTwo: $(".cup-02"), cupITcon: $(".cup-02-icon"), cupTwoTit: $(".cuptime-02-04"), cupThree: $(".cuptime-03-01"), cupThreeTit: $(".cup-03-title"), cupFourTit: $(".cup-04-tit"), cupFiveTit: $(".cup-05-04"), cupCText: $(".cup-05-07"), cupSixText: $(".cup-05-05"), cupTimeColor: $(".cup-05-10"), cupSevenTit: $(".cup-06"), cupEightTit: $(".cup-07-tit"), cupEightIndex: 0, cupEightPart: $(".cup-img"), cupEightPartTit: $(".cup-07-title"), cupNinePart: $(".cup-07-06"), cupNineImg: $(".cup-x"), cupNineTit: $(".cup-08"), cupTenIcon: $(".cup-09>ul>li"), cupTenIndex: 0, cupTenPic: $(".m-page"), pageAnimates: {downOne: function () {
    pageAnimateBox.navList.delay(500).animate({"top": "0", "opacity": 1}, 500);
    chageNavBg(1);
}, downTwo: function () {
    pageAnimateBox.cuptimeLeft.addClass("opacit-stop");
    pageAnimateBox.cuptimeRight.addClass("opacit-stop");
    pageAnimateBox.pnList.removeClass("fl-top-index");
    pageAnimateBox.pnList.eq(1).addClass("fl-top-index");
    pageAnimateBox.cupElm.remove();
    pageAnimateBox.cupElm.css({"position": "fixed"});
    $("body").append(pageAnimateBox.cupElm);
    var actionIcon = 0;
    mpTime = setInterval(function () {
        pageAnimateBox.mpZn.removeClass("mp-show");
        actionIcon++;
        pageAnimateBox.mpZn.eq(actionIcon).addClass("mp-show");
        if (actionIcon == pageAnimateBox.mpZn.length - 2) {
            clearInterval(mpTime);
        }
    }, 16);
    pageAnimateBox.cupElm.delay(600).animate({"opacity": 0}, 200, function () {
        pageAnimateBox.cupTwo.removeClass("cup-stop");
        pageAnimateBox.cupTwoTit.removeClass("opacit-stop");
        pageAnimateBox.cupITcon.removeClass("opacit-stop");
        pageAnimateBox.cupElm.css({"z-index": "-1"});
    });
    pageAnimateBox.cupTwo.css({"top": (Readchar.Style.getFullPageSize().height * 0.3) + 93});
}, downThree: function () {
    pageAnimateBox.cuptimeLeft.removeClass("fl-top-index");
    pageAnimateBox.cuptimeLeft.eq(2).addClass("fl-top-index");
    pageAnimateBox.pnList.removeClass("fl-top-index");
    pageAnimateBox.pnList.eq(2).addClass("fl-top-index");
    var setOne = setTimeout(function () {
        pageAnimateBox.cupThree.removeClass("cup-03-action");
        clearTimeout(setOne);
    }, 900)
    var setOut = setTimeout(function () {
        pageAnimateBox.cupThree.addClass("cup-03-stop");
        clearTimeout(setOut);
    }, 1800);
    pageAnimateBox.cupThreeTit.removeClass("opacit-stop");
}, downFour: function () {
    pageAnimateBox.cupFourTit.removeClass("opacit-stop");
    if (!pageAnimateBox.cupThree.hasClass("cup-03-action")) {
        pageAnimateBox.cupThree.addClass("cup-03-action");
    }
    if (pageAnimateBox.cupThree.hasClass("cup-03-stop")) {
        pageAnimateBox.cupThree.removeClass("cup-03-stop");
    }
}, downFive: function () {
    chageNavBg(0);
    pageAnimateBox.cupFourTit.addClass("opacit-stop");
    pageAnimateBox.cupFiveTit.removeClass("opacit-stop");
}, downSix: function () {
    chageNavBg(1);
    pageAnimateBox.cupSevenTit.removeClass("opacit-stop");
}, downSeven: function () {
    pageAnimateBox.cuptimeLeft.removeClass("fl-top-index");
    pageAnimateBox.cuptimeLeft.eq(3).addClass("fl-top-index");
    pageAnimateBox.pnList.removeClass("fl-top-index");
    pageAnimateBox.pnList.eq(3).addClass("fl-top-index");
}, downEight: function (direct) {
    if (direct == 0) {
        return false;
    }
    pageAnimateBox.cupNinePart.remove();
    pageAnimateBox.cupNinePart.css({"transform": "translate3d(0,0px,0) scale(0.49,0.49)", "-webkit-transform": "translate3d(0,0px,0) scale(0.49,0.49)", "-moz-transform": "translate3d(0,0px,0) scale(0.49,0.49)", "-o-transform": "translate3d(0,0px,0) scale(0.49,0.49)"});
    $("body").append(pageAnimateBox.cupNinePart);
    pageAnimateBox.cupNinePart.addClass("cup-hx");
    setTimeout(function () {
        pageAnimateBox.cupNinePart.css({"transform": "translate3d(0,100px,0) scale(1.0,1.0)", "-webkit-transform": "translate3d(0,100px,0) scale(1.0,1.0)", "-moz-transform": "translate3d(0,100px,0) scale(1.0,1.0)", "-o-transform": "translate3d(0,100px,0) scale(1.0,1.0)"});
    }, 50);
    var actionNIcon = 0;
    mnTime = setInterval(function () {
        pageAnimateBox.cupNineImg.removeClass("mpt-show");
        actionNIcon++;
        pageAnimateBox.cupNineImg.eq(actionNIcon).addClass("mpt-show");
        if (actionNIcon == pageAnimateBox.cupNineImg.length - 1) {
            clearInterval(mnTime);
        }
    }, 28);
    pageAnimateBox.cupNineTit.removeClass("opacit-stop");
}, downNine: function () {
    pageAnimateBox.cupNinePart.css({"transform": "translate3d(0,-150%,0)", "-webkit-transform": "translate3d(0,-150%,0)", "-moz-transform": "translate3d(0,-150%,0)", "-o-transform": "translate3d(0,-150%,0)"});
}, upOne: function () {
    pageAnimateBox.cupElm.remove();
    pageAnimateBox.cupElm.css({"position": "absolute"});
    pageAnimateBox.mpZnParent.append(pageAnimateBox.cupElm);
    pageAnimateBox.navList.animate({"top": "-70px"}, 500);
}, upTwo: function () {
    pageAnimateBox.cuptimeLeft.removeClass("opacit-stop");
    pageAnimateBox.cuptimeRight.removeClass("opacit-stop");
    pageAnimateBox.pnList.removeClass("fl-top-index");
    pageAnimateBox.pnList.eq(0).addClass("fl-top-index");
    pageAnimateBox.cupElm.stop().animate({"opacity": "1"}, 300);
    var actionuIcon = pageAnimateBox.mpZn.length - 1;
    mpuTime = setInterval(function () {
        pageAnimateBox.mpZn.removeClass("mp-show");
        actionuIcon--;
        pageAnimateBox.mpZn.eq(actionuIcon).addClass("mp-show");
        console.log("返回第" + actionuIcon + "帧");
        if (actionuIcon == 0) {
            clearInterval(mpuTime);
        }
    }, 16);
    pageAnimateBox.cupElm.css({"z-index": "1000"});
    pageAnimateBox.cupTwo.addClass("cup-stop");
    pageAnimateBox.cupTwoTit.addClass("opacit-stop");
}, upThree: function () {
    pageAnimateBox.pnList.removeClass("fl-top-index");
    pageAnimateBox.pnList.eq(1).addClass("fl-top-index");
    if (!pageAnimateBox.cupThree.hasClass("cup-03-action")) {
        pageAnimateBox.cupThree.addClass("cup-03-action");
    }
    if (pageAnimateBox.cupThree.hasClass("cup-03-stop")) {
        pageAnimateBox.cupThree.removeClass("cup-03-stop");
    }
}, upFour: function () {
    pageAnimateBox.cuptimeLeft.removeClass("fl-top-index");
    pageAnimateBox.cuptimeLeft.eq(2).addClass("fl-top-index");
    var setOne = setTimeout(function () {
        pageAnimateBox.cupThree.removeClass("cup-03-action");
        clearTimeout(setOne);
    }, 900)
    var setOut = setTimeout(function () {
        pageAnimateBox.cupThree.addClass("cup-03-stop");
        clearTimeout(setOut);
    }, 1800);
    pageAnimateBox.cupThreeTit.removeClass("opacit-stop");
}, upFive: function () {
    chageNavBg(1);
    pageAnimateBox.cupFourTit.removeClass("opacit-stop");
}, upSix: function () {
    pageAnimateBox.cupNinePart.css({"transform": "translate3d(0,0,0) scale(0.49,0.49)", "-webkit-transform": "translate3d(0,0,0) scale(0.49,0.49)", "-moz-transform": "translate3d(0,0,0) scale(0.49,0.49)", "-o-transform": "translate3d(0,0,0) scale(0.49,0.49)"});
    if (pageAnimateBox.cupEightIndex == 0) {
        return false;
    }
    var actionUpIcon = $(".cup-x").length - 1;
    mpTime = setInterval(function () {
        pageAnimateBox.cupNineImg.removeClass("mpt-show");
        actionUpIcon--;
        pageAnimateBox.cupNineImg.eq(actionUpIcon).addClass("mpt-show");
        if (actionUpIcon == 0) {
            clearInterval(mpTime);
        }
        console.log(actionUpIcon);
    }, 28);
    subTimeEi = setTimeout(function () {
        pageAnimateBox.cupNinePart.remove();
        pageAnimateBox.cupNinePart.removeClass("cup-hx");
        $(".cup-07-05").after(pageAnimateBox.cupNinePart);
        pageAnimateBox.cupNinePart.css({"transform": "translate3d(0,-457px,0) scale(0.49,0.49)", "-webkit-transform": "translate3d(0,-457px,0) scale(0.49,0.49)", "-moz-transform": "translate3d(0,-457px,0) scale(0.49,0.49)", "-o-transform": "translate3d(0,-457px,0) scale(0.49,0.49)"});
        clearTimeout(subTimeEi);
    }, 900);
}}, pageDownEffect: function (pageIndex, direct, prePageIndex) {
    if (pageIndex == prePageIndex) {
        return false;
    }
    console.log("开始执行第" + pageIndex + "动画");
    if (direct < 0) {
        switch (pageIndex) {
            case 1:
                this.pageAnimates.downOne();
                break;
            case 2:
                this.pageAnimates.downTwo();
                break;
            case 3:
                this.pageAnimates.downThree();
                break;
            case 4:
                this.pageAnimates.downFour();
                break;
            case 5:
                this.pageAnimates.downFive();
                break;
            case 6:
                this.pageAnimates.downSix();
                break;
            case 7:
                this.pageAnimates.downSeven();
                break;
            case 8:
                this.pageAnimates.downEight();
                break;
            case 9:
                this.pageAnimates.downNine();
                break;
        }
    }
    if (direct > 0) {
        switch (pageIndex) {
            case 7:
                this.pageAnimates.upSix();
                break;
            case 4:
                this.pageAnimates.upFive();
                break;
            case 3:
                this.pageAnimates.upFour();
                break;
            case 2:
                this.pageAnimates.upThree();
                break;
            case 1:
                this.pageAnimates.upTwo();
                break;
            case 0:
                this.pageAnimates.upOne();
                break;
        }
    }
    if (direct == 0) {
        if (pageIndex > prePageIndex) {
            if (pageIndex >= 1) {
                this.pageAnimates.downOne();
            }
            if (pageIndex >= 2) {
                this.pageAnimates.downTwo();
            }
            if (pageIndex >= 3) {
                this.pageAnimates.downThree();
            }
            if (pageIndex >= 4) {
                this.pageAnimates.downFour();
            }
            if (pageIndex >= 5) {
                this.pageAnimates.downFive();
            }
            if (pageIndex >= 6) {
                this.pageAnimates.downSix();
            }
            if (pageIndex >= 7) {
                this.pageAnimates.downSeven();
            }
            if (pageIndex >= 8) {
                this.pageAnimates.downEight(direct);
            }
            if (pageIndex >= 9) {
                this.pageAnimates.downNine();
            }
        }
        if (pageIndex < prePageIndex) {
            if (pageIndex <= 1) {
                this.pageAnimates.upTwo();
            }
            if (pageIndex <= 2) {
                this.pageAnimates.upThree();
            }
            if (pageIndex <= 3) {
                this.pageAnimates.upFour();
            }
            if (pageIndex <= 4) {
                this.pageAnimates.upFive();
            }
            if (pageIndex <= 7) {
                this.pageAnimates.upSix();
            }
        }
    }
}, pageFiveEffect: function (direct) {
    var num = Math.ceil(Math.random() * 10), cupOc = parseInt(this.cupCText.text());
    if (direct < 0) {
        cupOc -= num;
        if (cupOc < 0) {
            cupOc = 0;
        }
        this.cupCText.text(cupOc + "℃");
        if (cupOc == 0) {
            return true;
        }
        if (cupOc <= 35) {
            this.cupCText.css("background", "#00bfff");
            this.cupSixText.stop().animate({"top": "-240px"}, 500);
            this.cupTimeColor.eq(0).css({"display": "none"});
            this.cupTimeColor.eq(1).css({"display": "none"});
            this.cupTimeColor.eq(2).css({"display": "block"});
        }
    }
    if (direct > 0) {
        cupOc += num;
        if (cupOc > 95) {
            cupOc = 95;
        }
        this.cupCText.text(cupOc + "℃");
        if (cupOc == 95) {
            return true;
        }
        if (cupOc >= 75) {
            this.cupCText.css("background", "#ff4200");
            this.cupSixText.stop().animate({"top": "0"}, 500)
            this.cupTimeColor.eq(0).css({"display": "block"});
            this.cupTimeColor.eq(1).css({"display": "none"});
            this.cupTimeColor.eq(2).css({"display": "none"});
        }
    }
    if (cupOc < 75 & cupOc > 35) {
        this.cupCText.css("background", "#ffae00");
        this.cupSixText.stop().animate({"top": "-120px"}, 500);
        this.cupTimeColor.eq(0).css({"display": "none"});
        this.cupTimeColor.eq(1).css({"display": "block"});
        this.cupTimeColor.eq(2).css({"display": "none"});
    }
    return false;
}, pageSevenEffect: function (direct) {
    if (direct == 0) {
        return false;
    }
    if (direct < 0) {
        if (this.cupEightIndex == 7) {
            this.cupEightPartTit.eq(this.cupEightIndex + 1).removeClass("opacit-stop");
        }
        if (this.cupEightIndex < 8) {
            this.cupEightIndex++;
        } else {
            return true;
        }
        this.cupEightPartTit.eq(this.cupEightIndex - 1).removeClass("opacit-stop");
        this.cupEightPartTit.eq(this.cupEightIndex - 2).addClass("opacit-stop");
    }
    if (direct > 0) {
        if (this.cupEightIndex == 8) {
            this.cupEightPartTit.eq(this.cupEightIndex).addClass("opacit-stop");
        }
        if (this.cupEightIndex > 0) {
            this.cupEightIndex--;
        } else {
            return true;
        }
        if (this.cupEightIndex != 0) {
            this.cupEightPartTit.eq(this.cupEightIndex - 1).removeClass("opacit-stop");
        }
        this.cupEightPartTit.eq(this.cupEightIndex).addClass("opacit-stop");
    }
    if (this.cupEightIndex == 5) {
        this.cupEightPart.eq(this.cupEightIndex).css({"transform": "translate3d(0,0,0) scale(0.49,0.49)", "-webkit-transform": "translate3d(0,0,0) scale(0.49,0.49)", "-moz-transform": "translate3d(0,0,0) scale(0.49,0.49)", "-o-transform": "translate3d(0,0,0) scale(0.49,0.49)"});
    } else {
        this.cupEightPart.eq(this.cupEightIndex).css({"transform": "translate3d(0,0,0)", "-webkit-transform": "translate3d(0,0,0)", "-moz-transform": "translate3d(0,0,0)", "-o-transform": "translate3d(0,0,0)"});
    }
    if (this.cupEightIndex == 0) {
        this.cupEightTit.css({"transform": "translate3d(0,0,0)", "-webkit-transform": "translate3d(0,0,0)", "-moz-transform": "translate3d(0,0,0)", "-o-transform": "translate3d(0,0,0)"});
    }
    if (this.cupEightIndex == 1) {
        this.cupEightPart.eq(0).css({"transform": "translate3d(0,-" + 150 + "px,0)", "-webkit-transform": "translate3d(0,-" + 150 + "px,0)", "-moz-transform": "translate3d(0,-" + 150 + "px,0)", "-o-transform": "translate3d(0,-" + 150 + "px,0)"});
        this.cupEightTit.css({"transform": "translate3d(0,-" + 300 + "px,0)", "-webkit-transform": "translate3d(0,-" + 300 + "px,0)", "-moz-transform": "translate3d(0,-" + 300 + "px,0)", "-o-transform": "translate3d(0,-" + 300 + "px,0)"});
    }
    if (this.cupEightIndex == 2) {
        this.cupEightPart.eq(0).css({"transform": "translate3d(0,-" + 350 + "px,0)", "-webkit-transform": "translate3d(0,-" + 350 + "px,0)", "-moz-transform": "translate3d(0,-" + 350 + "px,0)", "-o-transform": "translate3d(0,-" + 350 + "px,0)"});
        this.cupEightPart.eq(1).css({"transform": "translate3d(0,-" + 200 + "px,0)", "-webkit-transform": "translate3d(0,-" + 200 + "px,0)", "-moz-transform": "translate3d(0,-" + 200 + "px,0)", "-o-transform": "translate3d(0,-" + 200 + "px,0)"});
    }
    if (this.cupEightIndex == 3) {
        this.cupEightPart.eq(0).css({"transform": "translate3d(0,-" + 680 + "px,0)", "-webkit-transform": "translate3d(0,-" + 680 + "px,0)", "-moz-transform": "translate3d(0,-" + 680 + "px,0)", "-o-transform": "translate3d(0,-" + 680 + "px,0)"});
        this.cupEightPart.eq(1).css({"transform": "translate3d(0,-" + 600 + "px,0)", "-webkit-transform": "translate3d(0,-" + 600 + "px,0)", "-moz-transform": "translate3d(0,-" + 600 + "px,0)", "-o-transform": "translate3d(0,-" + 600 + "px,0)"});
        this.cupEightPart.eq(2).css({"transform": "translate3d(0,-" + 150 + "px,0)", "-webkit-transform": "translate3d(0,-" + 150 + "px,0)", "-moz-transform": "translate3d(0,-" + 150 + "px,0)", "-o-transform": "translate3d(0,-" + 150 + "px,0)"});
    }
    if (this.cupEightIndex == 4) {
        this.cupEightPart.eq(0).css({"transform": "translate3d(0,-" + 830 + "px,0)", "-webkit-transform": "translate3d(0,-" + 830 + "px,0)", "-moz-transform": "translate3d(0,-" + 830 + "px,0)", "-o-transform": "translate3d(0,-" + 830 + "px,0)"});
        this.cupEightPart.eq(1).css({"transform": "translate3d(0,-" + 750 + "px,0)", "-webkit-transform": "translate3d(0,-" + 750 + "px,0)", "-moz-transform": "translate3d(0,-" + 750 + "px,0)", "-o-transform": "translate3d(0,-" + 750 + "px,0)"});
        this.cupEightPart.eq(2).css({"transform": "translate3d(0,-" + 300 + "px,0)", "-webkit-transform": "translate3d(0,-" + 300 + "px,0)", "-moz-transform": "translate3d(0,-" + 300 + "px,0)", "-o-transform": "translate3d(0,-" + 300 + "px,0)"});
        this.cupEightPart.eq(3).css({"transform": "translate3d(0,-" + 150 + "px,0)", "-webkit-transform": "translate3d(0,-" + 150 + "px,0)", "-moz-transform": "translate3d(0,-" + 150 + "px,0)", "-o-transform": "translate3d(0,-" + 150 + "px,0)"});
    }
    if (this.cupEightIndex == 5) {
        this.cupEightPart.eq(0).css({"transform": "translate3d(0,-" + 980 + "px,0)", "-webkit-transform": "translate3d(0,-" + 980 + "px,0)", "-moz-transform": "translate3d(0,-" + 980 + "px,0)", "-o-transform": "translate3d(0,-" + 980 + "px,0)"});
        this.cupEightPart.eq(1).css({"transform": "translate3d(0,-" + 900 + "px,0)", "-webkit-transform": "translate3d(0,-" + 900 + "px,0)", "-moz-transform": "translate3d(0,-" + 900 + "px,0)", "-o-transform": "translate3d(0,-" + 900 + "px,0)"});
        this.cupEightPart.eq(2).css({"transform": "translate3d(0,-" + 450 + "px,0)", "-webkit-transform": "translate3d(0,-" + 450 + "px,0)", "-moz-transform": "translate3d(0,-" + 450 + "px,0)", "-o-transform": "translate3d(0,-" + 450 + "px,0)"});
        this.cupEightPart.eq(3).css({"transform": "translate3d(0,-" + 300 + "px,0)", "-webkit-transform": "translate3d(0,-" + 300 + "px,0)", "-moz-transform": "translate3d(0,-" + 300 + "px,0)", "-o-transform": "translate3d(0,-" + 300 + "px,0)"});
        this.cupEightPart.eq(4).css({"transform": "translate3d(0,-" + 150 + "px,0)", "-webkit-transform": "translate3d(0,-" + 150 + "px,0)", "-moz-transform": "translate3d(0,-" + 150 + "px,0)", "-o-transform": "translate3d(0,-" + 150 + "px,0)"});
    }
    if (this.cupEightIndex == 6) {
        this.cupEightPart.eq(0).css({"transform": "translate3d(0,-" + 1130 + "px,0)", "-webkit-transform": "translate3d(0,-" + 1130 + "px,0)", "-moz-transform": "translate3d(0,-" + 1130 + "px,0)", "-o-transform": "translate3d(0,-" + 1130 + "px,0)"});
        this.cupEightPart.eq(1).css({"transform": "translate3d(0,-" + 1050 + "px,0)", "-webkit-transform": "translate3d(0,-" + 1050 + "px,0)", "-moz-transform": "translate3d(0,-" + 1050 + "px,0)", "-o-transform": "translate3d(0,-" + 1050 + "px,0)"});
        this.cupEightPart.eq(2).css({"transform": "translate3d(0,-" + 600 + "px,0)", "-webkit-transform": "translate3d(0,-" + 600 + "px,0)", "-moz-transform": "translate3d(0,-" + 600 + "px,0)", "-o-transform": "translate3d(0,-" + 600 + "px,0)"});
        this.cupEightPart.eq(3).css({"transform": "translate3d(0,-" + 450 + "px,0)", "-webkit-transform": "translate3d(0,-" + 450 + "px,0)", "-moz-transform": "translate3d(0,-" + 450 + "px,0)", "-o-transform": "translate3d(0,-" + 450 + "px,0)"});
        this.cupEightPart.eq(4).css({"transform": "translate3d(0,-" + 300 + "px,0)", "-webkit-transform": "translate3d(0,-" + 300 + "px,0)", "-moz-transform": "translate3d(0,-" + 300 + "px,0)", "-o-transform": "translate3d(0,-" + 300 + "px,0)"});
        this.cupEightPart.eq(5).css({"transform": "translate3d(0,-" + 150 + "px,0) scale(0.49,0.49)", "-webkit-transform": "translate3d(0,-" + 150 + "px,0) scale(0.49,0.49)", "-moz-transform": "translate3d(0,-" + 150 + "px,0) scale(0.49,0.49)", "-o-transform": "translate3d(0,-" + 150 + "px,0) scale(0.49,0.49)"});
    }
    if (this.cupEightIndex == 7) {
        this.cupEightPart.eq(0).css({"transform": "translate3d(0,-" + 1280 + "px,0)", "-webkit-transform": "translate3d(0,-" + 1280 + "px,0)", "-moz-transform": "translate3d(0,-" + 1280 + "px,0)", "-o-transform": "translate3d(0,-" + 1280 + "px,0)"});
        this.cupEightPart.eq(1).css({"transform": "translate3d(0,-" + 1200 + "px,0)", "-webkit-transform": "translate3d(0,-" + 1200 + "px,0)", "-moz-transform": "translate3d(0,-" + 1200 + "px,0)", "-o-transform": "translate3d(0,-" + 1200 + "px,0)"});
        this.cupEightPart.eq(2).css({"transform": "translate3d(0,-" + 750 + "px,0)", "-webkit-transform": "translate3d(0,-" + 750 + "px,0)", "-moz-transform": "translate3d(0,-" + 750 + "px,0)", "-o-transform": "translate3d(0,-" + 750 + "px,0)"});
        this.cupEightPart.eq(3).css({"transform": "translate3d(0,-" + 600 + "px,0)", "-webkit-transform": "translate3d(0,-" + 600 + "px,0)", "-moz-transform": "translate3d(0,-" + 600 + "px,0)", "-o-transform": "translate3d(0,-" + 600 + "px,0)"});
        this.cupEightPart.eq(4).css({"transform": "translate3d(0,-" + 450 + "px,0)", "-webkit-transform": "translate3d(0,-" + 450 + "px,0)", "-moz-transform": "translate3d(0,-" + 450 + "px,0)", "-o-transform": "translate3d(0,-" + 450 + "px,0)"});
        this.cupEightPart.eq(5).css({"transform": "translate3d(0,-" + 300 + "px,0) scale(0.49,0.49)", "-webkit-transform": "translate3d(0,-" + 300 + "px,0) scale(0.49,0.49)", "-moz-transform": "translate3d(0,-" + 300 + "px,0) scale(0.49,0.49)", "-o-transform": "translate3d(0,-" + 300 + "px,0) scale(0.49,0.49)"});
        this.cupEightPart.eq(6).css({"transform": "translate3d(0,-" + 150 + "px,0)", "-webkit-transform": "translate3d(0,-" + 150 + "px,0)", "-moz-transform": "translate3d(0,-" + 150 + "px,0)", "-o-transform": "translate3d(0,-" + 150 + "px,0)"});
    }
    if (this.cupEightIndex == 8) {
        this.cupEightPart.eq(0).css({"transform": "translate3d(0,-" + 1430 + "px,0)", "-webkit-transform": "translate3d(0,-" + 1430 + "px,0)", "-moz-transform": "translate3d(0,-" + 1430 + "px,0)", "-o-transform": "translate3d(0,-" + 1430 + "px,0)"});
        this.cupEightPart.eq(1).css({"transform": "translate3d(0,-" + 1350 + "px,0)", "-webkit-transform": "translate3d(0,-" + 1350 + "px,0)", "-moz-transform": "translate3d(0,-" + 1350 + "px,0)", "-o-transform": "translate3d(0,-" + 1350 + "px,0)"});
        this.cupEightPart.eq(2).css({"transform": "translate3d(0,-" + 1130 + "px,0)", "-webkit-transform": "translate3d(0,-" + 1130 + "px,0)", "-moz-transform": "translate3d(0,-" + 1130 + "px,0)", "-o-transform": "translate3d(0,-" + 1130 + "px,0)"});
        this.cupEightPart.eq(3).css({"transform": "translate3d(0,-" + 750 + "px,0)", "-webkit-transform": "translate3d(0,-" + 750 + "px,0)", "-moz-transform": "translate3d(0,-" + 750 + "px,0)", "-o-transform": "translate3d(0,-" + 750 + "px,0)"});
        this.cupEightPart.eq(4).css({"transform": "translate3d(0,-" + 600 + "px,0)", "-webkit-transform": "translate3d(0,-" + 600 + "px,0)", "-moz-transform": "translate3d(0,-" + 600 + "px,0)", "-o-transform": "translate3d(0,-" + 600 + "px,0)"});
        this.cupEightPart.eq(5).css({"transform": "translate3d(0,-" + 457 + "px,0) scale(0.49,0.49)", "-webkit-transform": "translate3d(0,-" + 457 + "px,0) scale(0.49,0.49)", "-moz-transform": "translate3d(0,-" + 457 + "px,0) scale(0.49,0.49)", "-o-transform": "translate3d(0,-" + 457 + "px,0) scale(0.49,0.49)"});
        this.cupEightPart.eq(6).css({"transform": "translate3d(0,-" + 300 + "px,0)", "-webkit-transform": "translate3d(0,-" + 300 + "px,0)", "-moz-transform": "translate3d(0,-" + 300 + "px,0)", "-o-transform": "translate3d(0,-" + 300 + "px,0)"});
        this.cupEightPart.eq(7).css({"transform": "translate3d(0,-" + 150 + "px,0)", "-webkit-transform": "translate3d(0,-" + 150 + "px,0)", "-moz-transform": "translate3d(0,-" + 150 + "px,0)", "-o-transform": "translate3d(0,-" + 150 + "px,0)"});
    }
    console.log("拆解第" + this.cupEightIndex + "结构");
    return false;
}, pageNineEffect: function (direct) {
    if (direct == 0) {
        return false;
    }
    if (direct < 0) {
        if (this.cupTenIndex < this.cupTenIcon.length - 1) {
            this.cupTenIndex++;
        } else {
            return true;
        }
    }
    if (direct > 0) {
        if (this.cupTenIndex > 0) {
            this.cupTenIndex--;
        } else {
            return true;
        }
    }
    this.cupTenIcon.removeClass("cup-09-01");
    this.cupTenIcon.eq(this.cupTenIndex).addClass("cup-09-01");
    this.cupTenPic.stop().animate({"opacity": 0}, 800);
    this.cupTenPic.eq(this.cupTenIndex).stop().animate({"opacity": 1}, 800);
    console.log("切换到第" + this.cupTenIndex + "幕");
    return false;
}}
function chageNavBg(index) {
    if (index == 0) {
        $(".navi-bg").css({"opacity": 0.8}, 800);
        $(".navi-fixed").addClass("navi-f-chang");
    }
    if (index == 1) {
        $(".navi-bg").css({"opacity": 0.05}, 800);
        $(".navi-fixed").removeClass("navi-f-chang");
    }
}
$(document).ready(function (e) {
    var movBtn = $(".cup-03-btn"), movLay = $(".cuptime-03-01");
    movBtn.mousedown(function (e) {
        document.onselectstart = function () {
            return false;
        }
        var downX = e.pageX, downY = e.pageY, btnX = parseInt(movBtn.css("left")), layX = parseInt(movLay.css("width")), btn_x = downX - btnX, lay_x = downX - layX;
        $(document).mousemove(function (e) {
            var mouseX = e.pageX;
            movLay.css({"width": mouseX - lay_x, "transition": "none", "-webkit-transition": "none", "-moz-transition": "none"});
        })
        movBtn.mouseup(function () {
            $(document).unbind("mousemove");
        });
        $(document).click(function () {
            $(document).unbind("mousemove");
        })
    });
    $(".cutptime-03-04").width(Readchar.Style.getFullPageSize().width);
    $(".cup-04").hover(function () {
        var i = $(".cup-04").index($(this))
        $(".cup-04-01").eq(i).stop().animate({"opacity": "0.8"}, 500);
        $(".cup-04-02").eq(i).stop().animate({"opacity": "1"}, 500);
        $(".cup-04-icon").eq(i).stop().animate({"opacity": "0"}, 500);
    }, function () {
        var i = $(".cup-04").index($(this))
        $(".cup-04-01").eq(i).stop().animate({"opacity": "0.2"}, 500);
        $(".cup-04-02").eq(i).stop().animate({"opacity": "0"}, 500);
        $(".cup-04-icon").eq(i).stop().animate({"opacity": "1"}, 500);
    });
    $(".lem-05-hover >img").bind({mouseover: function () {
        var index = $(".lem-05-hover >img").index($(this));
        Readchar.Event.stopPropagation(Readchar.Event.getEvent());
        switch (index) {
            case 0:
                $(".cup-line").eq(0).stop(0).animate({"width": "120px"}, 900, function () {
                    $(".cup-03-img").eq(0).removeClass("opacit-stop");
                });
                break;
            case 1:
                $(".cup-line").eq(1).stop().animate({"width": "150px"}, 500, function () {
                    $(".cup-line").eq(2).stop().animate({"width": "150px"}, 400, function () {
                        $(".cup-03-img").eq(1).removeClass("opacit-stop");
                    })
                })
                break;
            case 2:
                $(".cup-line").eq(3).stop().animate({"width": "270px"}, 800, function () {
                    $(".cup-line").eq(4).stop().animate({"width": "50px"}, 100, function () {
                        $(".cup-03-img").eq(2).removeClass("opacit-stop");
                    })
                })
                break;
            case 3:
                $(".cup-line").eq(5).stop().animate({"width": "160px"}, 600, function () {
                    $(".cup-line").eq(6).stop().animate({"width": "160px"}, 200, function () {
                        $(".cup-line").eq(7).stop().animate({"width": "50px"}, 100, function () {
                            $(".cup-03-img").eq(3).removeClass("opacit-stop");
                        });
                    })
                })
                break;
        }
    }, mouseout: function () {
        var index = $(".lem-05-hover >img").index($(this));
        Readchar.Event.stopPropagation(Readchar.Event.getEvent());
        switch (index) {
            case 0:
                $(".cup-03-img").eq(0).addClass("opacit-stop");
                $(".cup-line").eq(0).stop(0).animate({"width": "0"}, 700);
                break;
            case 1:
                $(".cup-03-img").eq(1).addClass("opacit-stop");
                $(".cup-line").eq(2).stop().animate({"width": "0"}, 400, function () {
                    $(".cup-line").eq(1).stop().animate({"width": "0"}, 500)
                })
                break;
            case 2:
                $(".cup-03-img").eq(2).addClass("opacit-stop");
                $(".cup-line").eq(4).stop().animate({"width": "0"}, 100, function () {
                    $(".cup-line").eq(3).stop().animate({"width": "0"}, 800)
                })
                break;
            case 3:
                $(".cup-03-img").eq(3).addClass("opacit-stop");
                $(".cup-line").eq(7).stop().animate({"width": "0"}, 100, function () {
                    $(".cup-line").eq(6).stop().animate({"width": "0"}, 200, function () {
                        $(".cup-line").eq(5).stop().animate({"width": "0"}, 600);
                    })
                })
                break;
        }
    }})
    $(".r-navi-icon").hover(function () {
        var navIndex = $(".r-navi-icon").index($(this));
        $(this).addClass("r-n-hover");
        $(".r-nav-hidden").eq(navIndex).stop().animate({"width": 125, "opacity": 1}, 500);
    }, function () {
        var navIndex = $(".r-navi-icon").index($(this));
        $(this).removeClass("r-n-hover");
        $(".r-nav-hidden").eq(navIndex).stop().animate({"width": 0, "opacity": 0}, 500);
    })
    $(".cuptime-title").removeClass("tit-stop");
    $(".cuptime-left").removeClass("left-stop");
    $(".cuptime-right").removeClass("right-stop");
});
window.onscroll = function () {
    if ($(document).scrollTop() > 500) {
        $(".navi-fixed").stop().animate({"top": "0", "opacity": "1"}, 500);
        $(".navi-bg").stop().animate({"opacity": "0.1"}, 500);
    }
    if ($(document).scrollTop() <= 500) {
        $(".navi-fixed").stop().animate({"top": "-65px", "opacity": "0"}, 500);
    }
}
var nStartY, sDirection;
function getStartY(event) {
    if (!event.touches.length)return;
    var touch = event.touches[0];
    nStartY = touch.pageY;
    console.log("getStartY->获得新的触屏高度值" + nStartY);
}
function getDirection(event) {
    event.preventDefault();
    if (!event.touches.length)return;
    var touch = event.touches[0];
    if (nStartY > touch.pageY) {
        sDirection = -1;
    } else if (nStartY < touch.pageY) {
        sDirection = 1;
    } else {
        return false;
    }
    console.log("getDirection->方向为" + sDirection);
}
window.onload = function () {
    $(".loading").remove();
    $(".cup-04-tit").css("top", ($(".mecare-page").height() - $(".cup-04").height()) / 2 - 68);
    $(".cup-04").css("top", $(".mecare-page").height() - $(".cup-04").height());
    if (window.Readchar.Browser.ie < 10) {
        $("body").css({"overflow-y": "scroll"});
        $(".navi-bg").css({"background": "#000", "opacity": "0.5"});
        $(".cuptime-title").removeClass("tit-stop");
        $(".cuptime-left").removeClass("left-stop");
        $(".cuptime-right").removeClass("right-stop");
        $(".cup-02").removeClass("cup-stop");
        $(".cup-02").css({"top": "50%"});
        $(".cup-02-icon").removeClass("opacit-stop");
        $(".cuptime-02-04").removeClass("opacit-stop");
        $(".cup-03-title").removeClass("opacit-stop");
        $(".cup-04-tit").removeClass("opacit-stop");
        $(".cup-05-04").removeClass("opacit-stop");
        $(".cup-06").removeClass("opacit-stop");
        $(".cup-08").removeClass("opacit-stop");
        $(".cup-07-tit").css("top", "7%")
        $(".right-navi").hide();
        $(".cup-09").hide();
        $(".lem-05-qb").hide();
        $(".lem-05-qc").hide();
        $(".mpt-show").hide();
    } else {
        Readchar.Plugins.pageScroll(["#header", "#page-01-show", "#page-02-show", "#page-03-show", "#page-04-show", "#page-05-show", "#page-06-show", "#page-07-show", "#page-08-show", "#page-09-show", "#footer"], ".mecare-page");
        Readchar.Event.addEvent(document, "touchstart", getStartY);
        Readchar.Event.addEvent(document, "touchmove", getDirection);
        $(".mecare-con").addClass("mecar-action");
    }
}
window.onresize = function () {
    $(".mecare-page").height(Readchar.Style.getFullPageSize().height);
    $(".cutptime-03-04").width(Readchar.Style.getFullPageSize().width);
}